package MathHomeWorkTest;

import java.util.Scanner;

/*
1、题目：一个5位数，判断它是不是回文数。即12321是回文数，
个位与万位相同，十位与千位相同
 */
public class MathTest6 {
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);
        System.out.println("请输入一个5位数");
        int num = s.nextInt();
        //if条件中对num取出万位与各位比较，十位与千位比较
        if((num /10000) == (num % 10) && (num % 100 / 10) == (num % 10000 /1000)){
            System.out.println(num+"为回文数");
        }else {
            System.out.println(num+"不是回文数");
        }
    }
}
